Skip to content

Conversation

logicoffee
Copy link

@logicoffee logicoffee commented Mar 8, 2025

Resolves #11331

Problem

Currently, EventTimeFilter is formatted as YYYY-MM-DD HH:MM:SS+00:00. However this format is not suitable for the following cases:

referencing tables where event_time isn't of type timestamp (especially in BigQuery).
For BigQuery, it's addressed by dbt-labs/dbt-bigquery#1422.
But casting event_time to timestamp causes a full scan.
When event_time is of type date, it's preferable to filter referenced tables using event_time > 'YYYY-MM-DD'
referencing sharded tables (especially in BigQuery).
Daily sharded tables are usually have a suffix like 'YYYYMMDD'.
It's better to filter referenced tables using _table_suffix > 'YYYY-MM-DD'.

Solution

Added format configuration to EventTimeFilter.
This PR depends on dbt-labs/dbt-adapters#893.

Checklist

  • I have read the contributing guide and understand what's expected of me.
  • I have run this code in development, and it appears to resolve the stated issue.
  • This PR includes tests, or tests are not required or relevant for this PR.
  • This PR has no interface changes (e.g., macros, CLI, logs, JSON artifacts, config files, adapter interface, etc.) or this PR has already received feedback and approval from Product or DX.
  • This PR includes type annotations for new and modified functions.

@cla-bot cla-bot bot added the cla:yes label Mar 8, 2025
@logicoffee logicoffee marked this pull request as ready for review March 8, 2025 11:12
@logicoffee logicoffee requested a review from a team as a code owner March 8, 2025 11:12
@github-actions github-actions bot added the community This PR is from a community member label Mar 8, 2025
Copy link
Contributor

github-actions bot commented Sep 5, 2025

This PR has been marked as Stale because it has been open with no activity as of late. If you would like the PR to remain open, please comment on the PR or else it will be closed in 7 days.

@github-actions github-actions bot added the stale Issues that have gone stale label Sep 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla:yes community This PR is from a community member stale Issues that have gone stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] Microbatch: Customize event_time_start/event_time_end format for referenced table filtering
1 participant